<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get process times</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.posix-times" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_times</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">posix_times</span> &mdash; <span class="dc-title">Get process times</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.posix-times-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_times</strong></span>
    ( <span class="methodparam">void</span>
   ) : <span class="type">array</span></div>

  <p class="para rdfs-comment">
   Gets information about the current CPU usage.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-times-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a hash of strings with information about the current
   process CPU usage. The indices of the hash are:
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      ticks - the number of clock ticks that have elapsed since
      reboot.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      utime - user time used by the current process.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      stime - system time used by the current process.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      cutime - user time used by current process and children.
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      cstime - system time used by current process and children.
     </span>
    </li>
   </ul>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.posix-times-notes">
  <h3 class="title">注释</h3>
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="para">
    This function isn&#039;t reliable to use, it may return negative values for
    high times.
   </p>
  </div>
 </div>


 <div class="refsect1 examples" id="refsect1-function.posix-times-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4355">
    <p><strong>Example #1 Example use of <span class="function"><strong>posix_times()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$times&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">posix_times</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$times</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [ticks] =&gt; 25814410
    [utime] =&gt; 1
    [stime] =&gt; 1
    [cutime] =&gt; 0
    [cstime] =&gt; 0
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div></div></div></body></html>